const Base = require('./index')

const table = 'sub'
const columnMap = {
    'mediaType': 'media_type',
}

class Sub extends Base {
    constructor(){
        super(table, columnMap)
    }
    
    async getByTmdbid(tmdbid) {
        const rows = await this.knex.select().from(this.table).where('tmdbid', tmdbid)
        return rows && rows.length > 0 ? this.warpModel(rows[0]) : null
    }
}


module.exports = new Sub()